package com.ny.demo513;

import java.util.Scanner;

public class Test02 {
    public static void main(String[] args) {
        for(int i =1;i<4;i++){
            Scanner scanner = new Scanner(System.in);
            System.out.println("请输入用户名");
            String username = scanner.next();
            System.out.println("请输入密码");
            String password = scanner.next();
            String u = "root";
            String p = "123456";
            if (username.equals(u)  &&  password.equals(p)){// 1==root
                System.out.println("你已经进入系统");
                break;
            }
            else {
                System.out.println("你的用户名或者密码错误");
            }
        }
    }
}
